<style scoped>
  .weui-form-preview__hd label, .weui-form-preview__hd em {
    font-size: .9em !important;
  }
  .weui-loadmore_line .weui-loadmore__tips {
    background-color: #eee;
  }
  .rj-cell.max span{
    font-size: 16px;
    padding-right: 20px;
  }
  .rj-cell label {
    color: #333;
    font-size: 14px;
    width: 44%;
    display: inline-block;
    padding: 5px 3%;
    text-align: right;
  }
  .rj-cell span {
    font-size: 14px;
    color: #333;
    display: inline-block;
    width: 50%;
  }
  .rj-cell.note label{
    float: left;
  }
  .rj-cell.note span{
    width: 80%;
    display: inline-block;
  }
  .weui-cells {
    margin-top: 0;
  }
  .weui-cells_form {
    background: #fbfbfb;
  }
  .weui-cell {
    background: #fff;
  }
  .weui-cells__title {
    text-align: left;
  }
  .oitem {
    padding: 3px;
  }
  .hide {
    display: none;
  }
  #acts {
    font-size: 0;
  }
  #acts span {
    font-size: 14px;
  }
  .halfbtn {
    display: inline-block;
    width: 49%;
  }
  .weui-label {
    text-align: left;
  }

  .weui_uploader_input_wrp {
    float: left;
    position: relative;
    margin-right: 9px;
    margin-bottom: 9px;
    width: 77px;
    height: 77px;
    border: 1px solid #D9D9D9;
  }
  .weui_uploader_hd {
    padding-top: 0;
    padding-right: 0;
    padding-left: 0;
  }
  .weui_uploader_files {
    list-style: none;
  }
  .weui_uploader_input_wrp:before {
    width: 2px;
    height: 39.5px;
  }
  .weui_uploader_input_wrp:before, .weui_uploader_input_wrp:after {
    content: " ";
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    background-color: #D9D9D9;
  }
  .weui_uploader_input {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }
  .weui_uploader_input_wrp:after {
    width: 39.5px;
    height: 2px;
  }
  .weui_uploader_bd {
    overflow: hidden;
  }
  .weui_cell {
    padding: 10px 15px;
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
  }
  .outstore >>> .weui-uploader_files {
    list-style: none;
    overflow-y: hidden;
  }
  .outstore >>> .weui-uploader_file {
    float: left;
    margin-right: 9px;
    margin-bottom: 9px;
    width: 79px;
    background: no-repeat 50%;
    background-size: cover;
  }
</style>
<template>
  <div class="oitem">
    <input type="hidden" :name="'items[' + itemNo + '].productguid'" :value="product.productid" />
    <input type="hidden" :name="'items[' + itemNo + '].productname'" :value="product.product" />
    <input type="hidden" :name="'items[' + itemNo + '].spguid'" :value="product.speid" v-if="picktype != 2" />
    <div class="weui-cells__title">货品明细 {{itemNo + 1}}</div>
    <div class="weui-cell fir">
      <div class="weui-cell__hd"><label class="weui-label">产品</label></div>
      <div class="weui-cell__bd">
        <input class="weui-input" type="text" name="" readonly="true" :value="product.product">
      </div>
    </div>
    <div class="weui-cell" v-if="picktype == 2">
      <div class="weui-cell__hd"><label for="" class="weui-label">规格</label></div>
      <div class="weui-cell__bd">
        <select class="weui-select room" :name="'items[' + itemNo + '].spguid'" >
          <option value="">请选择规格</option>
          <option v-for="(spec, index) in product.specifications" :key="spec.spguid">{{spec.specName}}</option>
        </select>
      </div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__hd"><label class="weui-label">重量(吨)</label></div>
      <div class="weui-cell__bd">
        <input class="weui-input weight" type="number" :name="'items[' + itemNo + '].weight'" placeholder="请输入重量">
      </div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__hd"><label for="" class="weui-label">库间</label></div>
      <div class="weui-cell__bd">
        <!--              <input class="weui-input shrguid" :id="'shrguid' + index" type="text" name="" placeholder="请选择库间">-->
        <!--              <input type="hidden" :id="'shrid' + index" name="items[0].shrguid">-->
        <select class="weui-select room" :name="'items[' + itemNo + '].shrguid'" >
          <option value="0">请选择库间</option>
          <option v-for="(hou, i) in houses" :key="hou.value" :value="hou.value">{{hou.title}} &nbsp; ({{hou.storeqty}} {{hou.unit}})</option>
        </select>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'OutStoreRmItem',
  data () {
    return {
      value: '',
      defaultResult: [],
      currentProduct: this.products[0].productid
    }
  },
  props: [
    'itemNo',
    'isLast',
    'product',
    'specifications',
    'houses',
    'picktype'
  ],
  computed: {
  },

  methods: {
    addItem: function() {
      this.$emit('doAddItem');
    },
    delItem: function() {
      this.$emit('doDelItem');
    },
    product(index) {
      return 'product' + index;
    },
    onSearch (val) {
      this.$emit('doSearch',val)
    },
    onCancel () {
      this.$emit('doSearch', '')
    },
    onSelect (val) {
      this.value = val;
    }
  }
}
</script>
